<template>
  <div>
    <Myheader title="人潮汹涌" />
    <div class="main">
      <component :is="comname"> </component>
    </div>

    <MyTabBar :list="tabList" @changebar="changeFn" />
  </div>
</template>

<script>
import Myheader from "./components/MyHeader";
import MyTabBar from "./components/MyTabBar";
import MyGoodsList from "./views/MyGoodsList";
import MySearch from "./views/MySearch";
import UserInfo from "./views/UserInfo";
export default {
  components: {
    Myheader,
    MyTabBar,
    MyGoodsList,
    MySearch,
    UserInfo,
  },
  name: "App",

  data() {
    return {
      comname: "MyGoodsList",
      tabList: [
        {
          iconText: "icon-shangpinliebiao",
          text: "商品列表",
          componentName: "MyGoodsList",
        },
        {
          iconText: "icon-sousuo",
          text: "商品搜索",
          componentName: "MySearch",
        },
        {
          iconText: "icon-user",
          text: "我的信息",
          componentName: "UserInfo",
        },
      ],
    };
  },
  methods: {
    changeFn(index) {
      this.comname = this.tabList[index].componentName;
    },
  },
};
</script>

<style>
.main {
  padding: 45px 0 50px 0;
}
</style>
